<h1><span></span><?= lang('label_your_credit') ?> <?= (double) account_wallet() . ' ' . lang('label_rs') ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="<?= base_url('user/profile') ?>"><?= lang('label_profile') ?></a></li>
    <li><?= lang('label_menu_link_mywallet'); ?></li>
</ul>


<div class="page">
    <table id="tablestyle">
        <thead>
            <tr class="head-row">
                <th><?= lang('label_created_from') ?></th>
                <th><?= lang('label_last_update') ?></th>
                <th><?= lang('label_wallet_operation_type') ?></th>
                <th><?= lang('label_wallet_amount') ?></th>
                <th style="width:270px;"><?= lang('label_wallet_note') ?></th>
                <th><?= lang('label_wallet_statues_type') ?></th>
            </tr>
        </thead>

        <tbody>
            <?php
            foreach ($result as $value) {
                $bank = get_wallet_bank($value->id);
                ?>
                <tr <? if (count($bank) > 0) { ?> class="row sweet-tooltip" data-style-tooltip="tooltip-sweet-strong" data-text-tooltip="<b><?= lang('label_wallet_bank') ?>: </b><?= $bank->bank_name ?>
                                                      <br /><b><?= lang('label_wallet_sender') ?>: </b><?= $bank->sender_name ?>
                                                      <br /><b><?= lang('label_wallet_account_number') ?> : </b><?= $bank->account_number ?>
                                                      <br /><b><?= lang('label_note') ?> : </b><?= $bank->note ?>"<? } ?>>
                    <td><?= timespan($value->create_date) ?> </td>
                    <td> <?= timespan($value->modify_date) ?></td>
                    <td style="text-align: center;"><img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() . '/images/' . $value->operation . '.png' ?>" style="width: 30%; text-align: center;"></td>
                    <td>
                        <? if (!empty($value->discount)) {
                            ?>
                            <b style="text-decoration: line-through"><?= $value->amount + get_discount_bank() ?></b>
                        <? } ?>
                        <?= $value->amount ?>
                    </td>
                    <td><?= $value->note ?> <? if ($value->admin_note != '') { ?> <div class="admin_note"><?= $value->admin_note ?></div> <? } ?></td>
                    <td><span class="stat-<?= $value->status ?>"><?= lang('label_wallet_statues_' . $value->status) ?></span></td>
                </tr>

            <? } ?>
        </tbody>
    </table>

    <div class="submit">
        <a href="<?= base_url() ?><?= get_segment(1) ?>/add"><?= lang('label_wallet_add_amount') ?></a>

        <a href="<?= base_url() ?><?= get_segment(1) ?>/withdraw"><?= lang('label_wallet_withdraw') ?></a>
    </div> 
</div>

<link rel="stylesheet" href="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>/views/<?php echo $this->themes->Cms_themes() ?>/css/sweet-tooltip.css">
<script>!window.jQuery && document.write(unescape('%3Cscript src="jquery-1.7.1.min.js"%3E%3C/script%3E'))</script>
<script type="text/javascript" src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>/views/<?php echo $this->themes->Cms_themes() ?>/js/sweet-tooltip.js"></script>
